From: Jasper St. Pierre Date: Thu, 13 Oct 2011 01:15:36 +0000 (-0400) Subject: st-texture-cache: Fix a minor crash when computing our border-radius X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7461 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cecb1a41fbe7b549d864c71d72cad72181ccf050;p=gnome-shell.git st-texture-cache: Fix a minor crash when computing our border-radius If we add a 0-sized actor with a border-radius, we will crash as we try to allocate a 0-sized texture in Cogl. Bail out early instead of doing that. https://bugzilla.gnome.org/show_bug.cgi?id=661617 --- diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c index b4d9e900e..440ca138a 100644 --- a/src/st/st-theme-node-drawing.c +++ b/src/st/st-theme-node-drawing.c @@ -342,12 +342,13 @@ st_theme_node_lookup_corner (StThemeNode *node, StCornerSpec corner; guint radius[4]; - if (node->border_radius[corner_id] == 0) - return COGL_INVALID_HANDLE; - cache = st_texture_cache_get_default (); st_theme_node_reduce_border_radius (node, radius); + + if (radius[corner_id] == 0) + return COGL_INVALID_HANDLE; + corner.radius = radius[corner_id]; corner.color = node->background_color; st_theme_node_get_corner_border_widths (node, corner_id,